<%@page import="com.User1"%>
<%@page import="org.hibernate.Query"%>
<%@page import="javax.transaction.Transaction"%>
<%@page import="org.hibernate.Session"%>
<%@page import="org.hibernate.SessionFactory"%>
<%@page import="org.hibernate.cfg.Configuration"%>
<%@ page language="java" import="java.util.*" pageEncoding="ISO-8859-1"%>
<h1 align="center">Hello Welcome</h1><br><br><br><br><br><br>
<%
HttpSession session2=request.getSession();
String uname=(String)session2.getAttribute("uname");
Configuration cfg=new Configuration();
cfg.configure();
SessionFactory sf=cfg.buildSessionFactory();
Session ses=sf.openSession();

String Query="from User1 where uname=? ";
Query qe=ses.createQuery(Query);
qe.setString(0, uname);
ArrayList ar=(ArrayList)qe.list();
Iterator it=ar.iterator();
while(it.hasNext()){
User1 us=(User1)it.next();
%>
<h4>UID:<%=us.getPid() %></h4>
<h4>Name:<%=us.getName() %></h4>
<h4>UserName:<%=us.getUname() %></h4>
<h4>Password:<%=us.getPassword() %></h4>

<%
}
%>